package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.HouseListBean;
import com.common.retrofit.entity.result.NewHouseQuBean;
import com.common.retrofit.service.HaiNingService;

import java.util.ArrayList;

import rx.Observable;
import rx.Subscriber;

public class GetNewHouseQuMethods extends BaseMethods {

    private static GetNewHouseQuMethods m_ins = null;

    public static GetNewHouseQuMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetNewHouseQuMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetNewHouseQuMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Map/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 获取新房第一层区的数据
    public void map_find_new(Subscriber<ArrayList<NewHouseQuBean>> subscriber, String city_str, String area_str, int house_price, int house_type, int house_selling_point, int small_price, int big_price) {
        Observable observable = initService().map_find_new(System.currentTimeMillis()+"",
                "d04e3a5527ad6d276e3407ee56680f3e",city_str,area_str,house_price,house_type,house_selling_point,small_price,big_price
        );
        toSubscribe(observable, subscriber);
    }
}
